import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/index.js'
import './assets/css/global.css'
import "./assets/font/font.css"
import './assets/css/bass.less'
import './plugins/element.js'
import Util from './util/util.js'
import axios from 'axios'
// 引入rem.js
import './util/rem.js'
import * as echarts from 'echarts'
import animated from 'animate.css'
import elTableInfiniteScroll from 'el-table-infinite-scroll';
// 导入全局经常使用的dialog弹框
import Dialog from '@/components/Common/Dialog.vue'
import Drawer from '@/components/Common/Drawer.vue'
import Title from '@/components/Common/Title.vue'
import SearchComp from '@/components/Common/SearchComponent.vue'
import RowItem from '@/components/Common/RowItem.vue'
import NoDate from '@/components/Common/NoDate.vue'
import Header from '@/components/Common/Header.vue'
import Footer from '@/components/Common/Footer.vue'
axios.defaults.baseURL = '/'
// 配置拦截器，携带token令牌
// 在request拦截器中，展示进度条Nprogress.start()
axios.interceptors.request.use(config => {
  // if (window.sessionStorage.getItem('token')) {
  //   // config.headers.accessToken = window.sessionStorage.getItem('token')
  // } else {
  //   // config.headers.Accesstoken = ''
  // }
  return config
})
// 配置response响应拦截器
// 在response拦截其中，结束进度条Nprogress.done()
axios.interceptors.response.use(config => {
  return config
})
Vue.prototype.$http = axios
Vue.prototype.$echarts = echarts
// 全局注册使用util类
Vue.prototype.$util = Util
Vue.use(animated)
Vue.use(elTableInfiniteScroll)
// 使用dialog全局组件
Vue.component(Dialog.name, Dialog)
Vue.component(Drawer.name, Drawer)
Vue.component(Title.name, Title)
Vue.component(SearchComp.name, SearchComp)
Vue.component(RowItem.name, RowItem)
Vue.component(NoDate.name, NoDate)
Vue.component(Header.name, Header)
Vue.component(Footer.name, Footer)
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
